package blog.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author HuLin
 * @date
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Comments implements Serializable {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String content;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    public Comments(Integer id, String content, Date createTime) {
	  this.id = id;
	  this.content = content;
	  this.createTime = createTime;
    }

    @TableField(select = false,exist = false)
    private User user;
    @TableField(select = false,exist = false)
    private Blog blog;

    private Integer uid;
    private Integer bid;
}
